import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  },
   {
    path: '/',
    name: 'login',
     component: () => import('../views/Login.vue'),
    
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  },
 
  {
    path: '/component',
    name: 'component',
    component: () => import('../views/Component.vue'),
    //路由的重定向默认访问component时直接跳转到/component/button
    redirect:'/component/usermanage',
    children: [
      {
        path: 'ordermanage',
        name: '/component/ordermanage',
        component: () => import('../views/OrderManage.vue'),
      },
      {
        path: 'housemanage',
        name: '/component/housemanage',
        component: () => import('../views/HouseManage.vue'),
      },
      {
        path: 'usermanage',
        name: '/component/usermanage',
        component: () => import('../views/UserManage.vue'),
       
      },
      {
        path:"addusermanage",
        name:"/component/addusermanage",
        component: () => import('../views/AddUserManage.vue'),
        meta:{
          breadcrumbs:['房源管理','添加房源']
        }

      },
      {
        path: 'contactrecord',
        name: '/component/contactrecord',
        component: () => import('../views/ContactRecord.vue'),
      },
       {
        path: 'parkmanage',
        name: '/component/parkmanage',
        component: () => import('../views/ParkManage.vue'),
      },
       {
        path: 'backusermanage',
        name: '/component/backusermanage',
        component: () => import('../views/BackUserManage.vue'),
      },
      {
        path: 'map',
        name: '/component/map',
        component: () => import('../views/Map.vue'),
      },
      {
        path: 'upload',
        name: '/component/uplaod',
        component: () => import('../views/upload.vue'),
      },
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
